#-------------------------------------------------------------------------------
# Name:        convert_ppt_file.py
# Purpose:     Executes conversion of input file to the SlideSpeech output
#
# Authors:     John Graves <john.graves@slidespeech.com>
#
# Copyright:   (c) Slidespeech Ltd 2012
# Licence:     MIT license
#-------------------------------------------------------------------------------

import webbrowser

from ppt_to_png_and_notes_converter import *

from qar_to_audio_converter import *
from html5_converter import *

if __name__ == "__main__":
    # run a test into tmp directory when self._debug is True

    # remove any temporary dir
    try:
        shutil.rmtree('tmp')
    except OSError as e:
        pass

    # Converting a PPT file
    i = PPTToPNGAndNotesConverter("test/One Slide One Question.pptx", "en")
    n = NotesToQARConverter(i)
    a = QARToAudioConverter(n)
    h = HTML5Converter('templates/includes',a)
    h.convert()
    url = 'file://localhost/'+h.tempDir()+'/html/index.html'
    webbrowser.open(url)



